# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=virt-what
pkgver=1.20
pkgrel=0
pkgdesc="Detect if we are running in a virtual machine"
url="https://people.redhat.com/~rjones/virt-what/"
arch="x86 x86_64 ppc64le aarch64"
license="GPL-2.0-or-later"
checkdepends="checkbashisms"
makedepends="automake autoconf perl-dev"
subpackages="$pkgname-doc"
source="https://people.redhat.com/~rjones/$pkgname/files/$pkgname-$pkgver.tar.gz
	"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare

	autoreconf -ivf
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

check() {
	make check

	checkbashisms ./virt-what
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="edf74903122bfb422c7a5ecba711bb64d6ef668828f208dfc0571ef14f2643456c14bc9a77dfea209df3d93869ac0a2c9fd039779922eddc6ebd9d988585dea4  virt-what-1.20.tar.gz"
